#ifndef QTABWIDGETEX_H
#define QTABWIDGETEX_H

#ifdef COMMONCTRL_LIB
# define COMMONCTRL_EXPORT Q_DECL_EXPORT
#else
# define COMMONCTRL_EXPORT Q_DECL_IMPORT
#endif


#include <QTabWidget>
#include <QMap>

class COMMONCTRL_EXPORT QTabWidgetEx : public QTabWidget
{
	Q_OBJECT

public:
	QTabWidgetEx(QWidget *parent);
	~QTabWidgetEx();
	void		setTabWidget(const QString&, QWidget* ,bool bDefault = false);
	QWidget*	getTabWidget(const QString&);
	void		addTab(QWidget *, const QString &);
	bool		contains(QWidget*);
	QWidget*	getDefaultWidget();
private:
	QMap<QString,QWidget*>		m_mapWidget;
	QVector<QWidget*>			m_vecWidget;
	QWidget*					m_pDefaultWidget;
protected slots:
	void		removeSubTab(int);
signals:
	void		closeTab(int);
};

#endif // QTABWIDGETEX_H
